\chapter{The Weenix OS}
\label{the-weenix-os}

\section{Motivation}


The Weenix operating system is a project for people interested in writing parts of a Unix kernel. The operating system was originally written in 1998 by teaching assistants for Brown University's operating systems course, taught by Professor Tom Doeppner, and has been maintained by that course's staff ever since. While the operating system is mostly based on early versions of Unix, it incorporates many recent developments in operating systems.
    
This book is intended to be a guide for students who are working on the Weenix operating system and those interested in contributing to it.
Part 1 is an introduction to Weenix, including the basics of setting up your development environment, using the build system, and running the OS in a virtual machine.
Part 2 contains five chapters, each of which specify an assignment. In the operating systems course taught at Brown, students have a choice between doing either:

\begin{itemize}
    \item All five assignments.
    \item A separate threads library assignment followed by two of the Weenix assignments (\wlink{vfs}{VFS} and \wlink{s5fs}{S5FS}).
\end{itemize}

Students pursuing the former option are assigned a mentor from the course staff who will be a source of clarification or hints if the student wishes. The latter option is provided to allow students who are not interested in a career in operating systems development to learn the basics of operating systems without spending the better part of their semester hacking the Weenix kernel. Each assignment chapter begins with an overview of the assignment, then describes the expected implementation in more detail, and ends with tips for testing.
Part 3 describes the inner workings of some key parts of the kernel not typically explored during the assignments. This is mainly a resource for those wishing to contribute to the Weenix project.
Finally, several appendices are included which provide more details about development tools, online resources, and the protocols of contributing new code.

\section{How to Read This Book}
We expect that there are at least two groups of people who will want to read this book. If you are someone who wants to see Weenix run \emph{right now}, jump ahead to \nameref{quickstart}. Everyone else should begin by reading \nameref{project-management} and then can read the assignments, manual, and appendices in whatever order they please. However, if you plan to do the assignments, we recommend that you do them in order, as they build on top of one another.

\section{History}
The Weenix OS, and the course that it grew up with, have a long and illustrious history. Although the Brown operating systems course has been taught since the 1960s, Weenix was first written in the spring of 1998, running on what was known only as the Brown Simulator 2.0. The two pieces of software were written by Keith Adams, Michael Castelle, Caroline Dahllof, Jason Lango, and Dave Powell. The name Weenix (``little *nix'') was invented by Keith Adams, and the OS was designed based on early versions of Unix. In 2004, a competing Brown operating system based on Windows (named HipOS) was created by Hari Khalsa, whose effort was apparently completely vanquished. During 2007-2009, Weenix moved off of the Brown Simulator and onto Xen virtual machines, an effort spearheaded by David Pacheco, Joel Weinberger, Dan Kuebrich, and Dimo Bounov. In 2010, Weenix found its current home running on Bochs, a virtual machine including a simulated real machine. Chris Siden, Alvin Kerber, and Shaun Verch were the major contributors for this move.

The features of Weenix now include:
\begin{itemize}
    \item Intelligent multitasking
    \item Virtual memory
    \item Terminal emulation
    \item Polymorphic file system support
    \item Advanced device support (including APIC and PATA with BMIDE)
\end{itemize}

\section{Acknowledgements}
Weenix would not have been possible without the help of many earnest, devoted individuals. Thanks first to Professor Tom Doeppner, for his patient guidance and leadership.

Thanks also to the many course TAs since the creation of Weenix.
\begin{itemize}
    \item['98-'99] Mike Castelle, David Powell, Caroline Dahllof, Tim Rowley
    \item['99-'00] Thomas Crulli, Matt Eccleston, Keith Adams, Matt Ahrens, Tim Rowley
    \item['00-'01] Matt Ahrens, Adam Leventhal, Matt Amdur, Pete Demoreuille, Ioannis Tsochantaridis
    \item['01-'02] Pete Demoreuille, Peter Griess, Fareed Behmaram-Mosavat, Dan Polivy, Dmitriy Genzel
    \item['02-'03] Kit Colbert, Sean Cannella, Albert Huang, Eric Schrock, Mark Ture
    \item['03-'04] Susannah Raub, Dan Stowell, Luke Peng, Pat Sunday, David Reiss
    \item['04-'05] Mark Johnson, Stacy Wong, Sean Smith, Dan Spinosa, Hari Khalsa
    \item['05-'06] Lucia Ballard, Eric Tamura, Edwin Chang, Pat Culhane, Adam Fenn
    \item['06-'07] Dan Leventhal, Aaron Myers, Adam Cath, Dave Pacheco, Joel Weinberger
    \item['07-'08] Colin Gordon, Itay Neeman, Dan Kuebrich, Aurojit Panda, Lincoln Quirk, Owen Strain
    \item['08-'09] Andres Douglas, Tim O'Donnell, Dimitar Bounov, Brandon Diamond, Travis Fischer, Allan Shortlidge
    \item['09-'10] Spencer Brody, Robert Mustacchi, Chris Siden, Travis Webb
    \item['10-'11] Chris Siden, Venkatasubramanian Jayaraman, Alvin Kerber, Matt Mallozzi, Ryan Zelen
    \item['11-'12] Shaun Verch, Dan Kimmel, J. Rassi, Basil Crow, Irina	Calciu, Nickolay Ratchev, Andrew Ayer, Marcelo Martins
\end{itemize}
In particular, many thanks to Keith Adams, Adam Fenn, Dave Pacheco, Dimitar Bounov, Alvin Kerber, and Chris Siden for their major contributions to the project.

Finally, thanks to the innumerable students who have implemented Weenix over the years. We hope the knowledge you gained in the process has served you well.

